
var str = "fjskfjsl fjkdsjfkls fjklsfjlsd127.0.0.1fjksldfjafjio jfk192.168.1.101sljfs fsdjfkldsfjsklfsklffjoijfoiafasfjs fed jfjf jf sdjfsi jfi jafis function dd ( ) { }afjsdiajf iosa function abc(){} jfisjad fjsaiofjaoissfaddedfds";

var ip = /1[1-9][1-9]\.1[1-9][0-9]\.([1-9][0-9]|[0-9])\.([1-2][0-9][0-9]|[0-9])/;

var test = ip.test(str);
var result = ip.exec(str);
console.log(test);
console.log(result);
